import React, { Component } from 'react';
import 'element-theme-default';
import { Button } from "element-react" ;
import {Upload } from "element-react" ;

class Picture extends Component {
    render() {
        const fileList2 = [
        //   {name: 'food.jpeg', url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg'}, {name: 'food2.jpeg', url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg'}
        ]
    
        return (
            <div >
                <el-from-item>
                    {/* <Upload
                        class='upload-demo'
                        action="http://" 
                        onPreview='handlePreview'
                        onRemove='handeleRemove'
                        on-success='upSuccess'
                        on-error='handleError'
                        before-uplode='beUpload'
                        // fileList='fileList'
                        data='postData'
                        limit='1'
                        list-type='picture'
                        showFileList='ture'
                        listType='picture'> */}
                    <Upload
                        className="upload-demo"
                        action='//jsonplaceholder.typicode.com/posts/'                   
                        onPreview={file => this.handlePreview(file)}
                        onRemove={(file, fileList) => this.handleRemove(file, fileList)}
                        fileList={fileList2}
                        listType='picture'
                        >
                    {/* <el-image src='http://qkpa8y0ib.hb-bkt.clouddn.com/book.png' ></el-image> */}
                    <Button size='small' type='primary'>上传图片</Button>
                    </Upload>
                </el-from-item> 
            </div>
        )
    }
    handleRemove(file, fileList) {
        //console.log(file, fileList);
      }
      
      handlePreview(file) {
        //console.log(file);
      }
    

}
export default Picture